﻿using System;
using System.Collections.Generic;
using Portal.Model;

namespace Portal.Repository
{
	/// <summary>
	/// Interface <see cref="IContactInfoRepository"/> declare repository of contact info
	/// </summary>
	public interface IContactInfoRepository : IDisposable
	{
		/// <summary>
		/// Add or update user
		/// </summary>
		/// <param name="user">The user</param>
		/// <param name="repository">The repository</param>
		/// <param name="contactInfo">The contact info</param>
		IContactInfo AddOrUpdate(IUser user, IContactInfo contactInfo);

		/// <summary>
		/// Delete all user contact infos
		/// </summary>
		/// <param name="user">The user</param>
		/// <param name="repository">The repository</param>
		void DeleteAllBy(IUser user);

		/// <summary>
		/// Gets user contact infos by its login
		/// </summary>
		/// <param name="login"></param>
		/// <returns>User</returns>
		IEnumerable<IContactInfo> GetAllBy(string login);
	}
}